home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / interp / perl5.005.tar.gz / perl5.005.tar / perl5.005 / t / op / glob.t < prev    next >
Text File  |  1998-07-19  |  898b  |  38 lines

  1. #!./perl
  2.  
  3. # $RCSfile: glob.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:55 $
  4.  
  5. print "1..6\n";
  6.  
  7. @oops = @ops = <op/*>;
  8.  
  9. if ($^O eq 'MSWin32') {
  10.   map { $files{lc($_)}++ } <op/*>;
  11.   map { delete $files{"op/$_"} } split /[\s\n]/, `cmd /c "dir /b /l op & dir /b /l /ah op 2>nul"`,
  12. }
  13. else {
  14.   map { $files{$_}++ } <op/*>;
  15.   map { delete $files{$_} } split /[\s\n]/, `echo op/*`;
  16. }
  17. if (keys %files) {
  18.     print "not ok 1\t(",join(' ', sort keys %files),"\n";
  19. } else { print "ok 1\n"; }
  20.  
  21. print $/ eq "\n" ? "ok 2\n" : "not ok 2\n";
  22.  
  23. while (<jskdfjskdfj* op/* jskdjfjkosvk*>) {
  24.     $not = "not " unless $_ eq shift @ops;
  25.     $not = "not at all " if $/ eq "\0";
  26. }
  27. print "${not}ok 3\n";
  28.  
  29. print $/ eq "\n" ? "ok 4\n" : "not ok 4\n";
  30.  
  31. # test the "glob" operator
  32. $_ = "op/*";
  33. @glops = glob $_;
  34. print "@glops" eq "@oops" ? "ok 5\n" : "not ok 5\n";
  35.  
  36. @glops = glob;
  37. print "@glops" eq "@oops" ? "ok 6\n" : "not ok 6\n";
  38.